package com.wuyou.designPatterns.singleton;

/**
 * 懒汉单列：使用时未创建再去创建对象
 */
public class Singleton1 {

    private Singleton1 singleton1;

    private Singleton1(){}

    public Singleton1 getInstance(){
        if (this.singleton1 == null) {
            singleton1 = new Singleton1();
        }
        return this.singleton1;
    }
}
